<!--主题切换按钮-->
<script setup lang="ts">
import {Icon} from "@iconify/vue";
import {useTheme} from "vuetify";

const appStore = useAppStore();

const theme = useTheme();
const {darkTheme} = storeToRefs(useCustomizeThemeStore())


const toggleTheme = () => {
  // theme.global.name.value = theme.global.current.value.dark ? "light" : "dark";
  darkTheme.value = !darkTheme.value;
};

const isDark = computed(() => darkTheme.value);
</script>

<template>

  <Icon class="cursor-pointer mr-4"  @click="toggleTheme" v-if="isDark" width="20" icon="line-md:moon-filled-loop"/>
  <Icon class="cursor-pointer mr-4 text-primary"  @click="toggleTheme" v-else
        width="20"
        icon="line-md:moon-filled-alt-to-sunny-filled-loop-transition"
  />

</template>

<style scoped lang="scss"></style>
